from openpyxl import load_workbook

def file_iterator(path, chunk_size=512):  # 用于形成二进制数据
    with open(path, 'rb') as f:
        while True:
            c = f.read(chunk_size)
            if c:
                yield c
            else:
                break

# 读取excel文件
def reading_file(file):
    try:
        wb = load_workbook(file)
        ws = wb.active
        rows = []
        for row in ws:
            dict_data = {'tel':str(row[0].value),'udata':str(row[1].value)}
            rows.append(dict_data)
        del rows[0]
        return rows
    except Exception as e:
        print(e)
        return